<?php
	class dathangbs
	{
		public $MaGioHang	= 0;
		public $MaNguoiDung	= 0;
		public $DiaChi = '';
		public $DienThoai	= '';
		public $NgayMuaHang	= 0;
        public $NgayGiaoHang	= 0;
		public $TinhTrang	= 0;
        
        //Phân trang
        public $SoGioHang = 6;
        public $P = 1;
		
		public function GetList($order = '', $start = 0, $num = 30, $all = 0)
		{
			$db = new dathangdb();
			return $db->GetList($this->MaGioHang, $this->MaNguoiDung, $this->TinhTrang, $order, $start, $num, $all);
		}
		
		public function Add(&$madathang = 0)
		{
			$db = new dathangdb();
			return $db->Add(&$madathang, $this->MaNguoiDung, $this->DiaChi, $this->DienThoai, $this->NgayMuaHang, $this->NgayGiaoHang, $this->TinhTrang);
		}
		
		public function Delete()
		{
			$db = new dathangdb();
			return $db->Delete($this->MaDatHang);
		}
        
        public function Update()
		{
			$db = new dathangdb();
			return $db->Update($this->MaGioHang, $this->TinhTrang);
		}
		
		public function CountList()
		{
			$db = new dathangdb();
			return $db->CountList();
		}
        
        public function TotalPage()
        {
            $db = new dathangdb();
			return $db->TotalPage($this->SoGioHang, $this->MaGioHang);
        }
        
        public function Paging()
        {
            $db = new dathangdb();
			return $db->Paging($this->SoGioHang, $this->P, $this->MaGioHang, $this->TinhTrang);
        }
	}
?>